<script src="<?php echo base_url() ?>commons/tablas/media/js/jquery.js" type="text/javascript"></script>
<script src="<?php echo base_url() ?>commons/tablas/media/js/jquery.dataTables.js" type="text/javascript"></script>
<style type="text/css" title="currentStyle">
			@import "<?php echo base_url() ?>commons/tablas/media/css/demo_page.css";
			@import "<?php echo base_url() ?>commons/tablas/media/css/demo_table.css";
		</style>
<script type="text/javascript">
    var t=jQuery.noConflict();
			t(document).ready(function() {
				t('#example').dataTable( {
					"sPaginationType": "full_numbers"
				} );
			} );
</script>

<div id="buscar1"  align="center">

    <form class="well form-search" action="<?php echo base_url() . "admin.php/matdevolucion/crear/" ?>" method="post" >
        <div class="control-group">
            <label class="control-label" for="select01">PERIODO ACTUAL</label>
            <div class="controls ">
                <select name="ide_per" class="span3" autofocus
                        ONCHANGE="javascript:enviar(this.options[this.selectedIndex].value, '<?php echo (base_url()) . "admin.php/matdevolucion/inicio" ?>');">
                            <?php
                            if ($ide_per == -1)
                                echo ("<option value='-1' selected>Seleccionar Periodo</option>");
                            foreach ($periodos as $i => $per) {
                                echo ("<option value='" . $per["ide_lec"] ."'".($per['ide_lec'] == $ide_per ? " selected" : " ").">");
                                echo ($per["descripcion_lec"] . "</option>");
                            }
                            ?>
                </select>
                 <?php if ($ide_per != -1)  ?>
                        <input  type="hidden"  name="ide_per" value=" <?php echo $ide_per; ?>" >
                        <input class="btn" type="submit"  value="Nueva Devolucion" <?php echo (($ide_per == -1) ? "disabled " : " "); ?>>
                

            </div>
        </div>



<?php if (!empty($inscritos)) { ?>

    <div id="tabla" >
        <h3>LISTADO DE ESTUDIANTES RETIRADOS Y DEVOLUCIONES</h3>
        <table id="example" class="table table-bordered table-striped table-condensed">
            
            <thead>
                <tr>
                    <th>CEDULA </th>
                    <th>APELLIDOS</th>
                    <th>NOMBRES</th>
                    <th>CARRERA</th>
                    <th>CICLO</th>
                    <th>MATRICULA</th>
                    <th>OPCION</th>
                </tr>
            </thead>
            <tbody>
                <?php
                $id_matr="";
                foreach ($inscritos as $i => $row) {
                    if ($id_matr!=$row['id_matr']){
                        $id_matr=$row['id_matr'];
                    ?>
                    <tr>

                        <td><?php echo $row['cedula_pers'] ?></td>
                        <td><?php echo $row['apellido_pers'] ?></td>
                        <td><?php echo $row['nombre_pers'] ?></td>
                        <td><?php echo $row['nombre_car'] ?></td>
                         <td><?php echo ($row['modo_mat']==1?$row['nombre_cic']:
                             ($row['modo_mat']==2?$row['nombre_cic']:
                             ($row['modo_mat']==3?"CONVALIDA":"MATERIAS"))) ?></td>
                        <td>
                            <?php
                              if ($row['estado_matr'] == 5)
                                  echo "RETIRADO";
                              elseif ($row['estado_matr'] == 4) 
                                  echo "DEVOLUCION ";
                              
                              ?></td>

                        <td>
                            <a href='<?php echo (base_url() . "admin.php/matdevolucion/estudlistamat/". $ide_per . "/" . $row['id_matr'] ."/upd"); ?>'>
                                <i class="icon-edit"></i>Edit</a>
                        </td>

                    </tr>
                    <?php
                    }
                }
                ?>
            </tbody>
        </table>        
    </div>        




<?php } ?>



